<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require_once('..\\common.php');
require_once('..\\predefine.php');
require_once("listclient.php");
CheckSalerLogon();

$firsttime = $_SESSION["firsttime"];
?>

<title>成员主页</title>
	
<link type="text/css" href="../css/smoothness/jquery-ui-1.7.1.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.7.1.custom.min.js"></script>
<link href='saler.css' rel="stylesheet" type="text/css"/>	
<link href="../css/default.css" rel="stylesheet" type="text/css"/>	

<link href="facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../js/jquery-ui-1.7.1.custom.min.js"></script>
<script src="facebox/facebox.js" type="text/javascript"></script>
<script src="../js/plugin/jquery.timers-1.1.2.js" type="text/javascript"></script>

	<script type="text/javascript" src='../js/plugin/jquery.clockpick.1.2.5.js'></script>    
	<link type="text/css" href='../js/plugin/clockpick.1.2.5.css' rel="stylesheet" />


<script src="../js/plugin/jquery.marquee.js" type="text/javascript"></script>

		<script type="text/javascript">
			$(function(){
					   
				$(".datepicker").datepicker();
				$('.datepicker').datepicker('option', {dateFormat: 'yy-mm-dd'});

				// Tabs
				$('#tabs').tabs();		
				
				$('a[rel*=facebox]').facebox();	
				
				// Dialog			
				$('#dialog').dialog({
					autoOpen: false,
					width: 300					
				});
				
			
				$(".todotime").clockpick();			

				<?php if($firsttime){ ?>
				//list today task
				$('#todaytask').dialog({
					autoOpen: false,
				});
				//open todolist	
				$('#todaytask').dialog('open');
			
				// Dialog Link
				$('#dialog_link').click(function(){
					$('#dialog').dialog('open');
					return false;
				});
				<?php } ?>
				$('div.marquee marquee').marquee('pointer').mouseover(function () {
           				 $(this).trigger('stop');
       			 }).mouseout(function () {
            			$(this).trigger('start');
       			 }).mousemove(function (event) {
           			 if ($(this).data('drag') == true) {
                		this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
           		 }
       			 }).mousedown(function (event) {
          			  $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
       			 }).mouseup(function () {
          		  $(this).data('drag', false);
        		 });
				
				
				
				var msgtag = $("div.marquee p");
				function updateTag(){					
					$.post("todaymsg.php", {}, function(data){
							if (data.length>0){	msgtag.html(data);	}
							}
					);
				}
				updateTag();
				msgtag.everyTime(5000,function() {										
					updateTag();					
				});

				
			});		
			
		</script>

</head>



<body>



<?php 
$salerid = $_SESSION["salerid"];
//echo $userid;
$DB = DBConnect();
?>
<div >
  <div class="topbar" style="float:right" ><a href="#" id="dialog_link" >修改密码</a>   <a href="logout.php">退出</a></div>
</div>

  <p>&nbsp;</p>

<div class="marquee">                   
  <p>今日消息</p>
</div>


<div  class="topbar" > 
  <p><a href="clientform1.php?clientid=-1">添加客户资料</a> <a href="todolist.php#tabs-0">今日计划任务</a> <a href="searchform.php">搜索</a></p>
</div>




<div >
<div id="tabs">
			<ul>
				<li><a href="#tabs-1">一般客户</a></li>
				<li><a href="#tabs-2">意向客户</a></li>
				<li><a href="#tabs-3">成交客户</a></li>
                <li><a href="#tabs-5">黑客户</a></li>
                <li><a href="#tabs-6">重点客户</a></li>
                <li><a href="#tabs-4">配合客户</a></li>
			</ul>
            
			<div id="tabs-1">
            <?php listownclient(0,$salerid,$DB);?>
            </div>
            
			<div id="tabs-2">
             <?php listownclient(1,$salerid,$DB);?>
            </div>
			
            <div id="tabs-3">
            <?php listownclient(2,$salerid,$DB);?>
            </div>
            
            <div id="tabs-5">
            <?php listownclient(3,$salerid,$DB);?>
            </div>
            
             <div id="tabs-6">
            <?php listownclient(4,$salerid,$DB);?>
            </div>
            
            <div id="tabs-4">
            <?php listhandleclient($salerid,$DB);?>
            </div>
</div>
</div>


</body>
<div id="dialog" title="修改密码">
<form id="formpassed" name="formpassed" method="post" action="changepasswd.php">
  	<label>新密码:
   	 <input type="password" name="newpasswd" id="newpasswd" />
  	</label>
 	 <label>
   	 <input type="submit" name="submit" id="submit" value="提交" />
  	</label>
</form>
</div>

<?php 
if($firsttime){
	echo "<div id ='todaytask' title ='今日任务'>";
	require_once("listclienttodo.php");
	listClientToCall($salerid,$DB,0);	
	echo "</div>";
	$_SESSION["firsttime"] = false;
}
?>

</html>

